import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import(/* webpackChunkName: "login" */'../pages/login/login.vue')
    },
    {
        path: '/index',
        name: 'index',
        component: () => import(/* webpackChunkName: "index" */ '../pages/home/index.vue'),
        redirect: '/indexPage',
        children: [
            {
                path: '/indexPage',
                name: 'indexPage',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/home/indexPage.vue'),
            }
        ]
    },
    {
        path: '/user',
        name: 'user',
        component: () => import(/* webpackChunkName: "index" */ '../pages/home/index.vue'),
        redirect: '/userlist',
        children: [
            {
                path: '/userlist',
                name: 'userlist',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/user/index.vue'),
            },
            {
                path: '/role',
                name: 'role',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/role/index.vue'),
            },
            {
                path: '/menu',
                name: 'menu',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/menu/index.vue'),
            },
        ]
    },
    {
        path: '/setting',
        name: 'setting',
        component: () => import(/* webpackChunkName: "index" */ '../pages/home/index.vue'),
        redirect: '/system',
        children: [
            {
                path: '/system',
                name: 'system',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/system/index.vue'),
            },
            {
                path: '/massage',
                name: 'massage',
                component: () => import(/* webpackChunkName:'indexPage'*/'../pages/massage/index.vue'),
            }
        ]
    },
]

const router = new VueRouter({
    mode: 'hash',
    routes
})

export default router
